package com.summer.entity;

import lombok.Data;
import org.apache.ibatis.type.Alias;

import java.util.Date;

/**
 * 借款用户登陆信息表
 */
@Alias("SourceUserLoginInfo")
@Data
public class SourceUserLoginInfo extends BaseEntity {

	private static final long serialVersionUID = 1L;
	
	/** 登陆用户的手机号 */
	private String phoneNumber;
	
	/** 用户访问的h5页面id */
	private String sourceH5Code;
	
	/** 访问次数 */
	private Integer loginTimes;
	
	/** ip地址 */
	private String ipAddress;
	
	/** 渠道商编号，可以为空，避免用户手动修改url，如果是从公众账号进来，这里记录source_h5_id */
	private String sourceChannelCode;
	
	/** 短信验证码，有效时间24h，login_time作比较，如果间隔大于24h,需要重新发短信 */
	private String messageCode;
	
	/** 访问时间，上一次获取验证码 */
	private Date lastCodeTime;

	public SourceUserLoginInfo() {
	}

	public SourceUserLoginInfo(String phoneNumber, String sourceH5Code, Integer loginTimes, String ipAddress, String sourceChannelCode, String messageCode, Date lastCodeTime) {
		this.phoneNumber = phoneNumber;
		this.sourceH5Code = sourceH5Code;
		this.loginTimes = loginTimes;
		this.ipAddress = ipAddress;
		this.sourceChannelCode = sourceChannelCode;
		this.messageCode = messageCode;
		this.lastCodeTime = lastCodeTime;
	}

	public static long getSerialVersionUID() {
		return serialVersionUID;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public String getSourceH5Code() {
		return sourceH5Code;
	}

	public void setSourceH5Code(String sourceH5Code) {
		this.sourceH5Code = sourceH5Code;
	}

	public Integer getLoginTimes() {
		return loginTimes;
	}

	public void setLoginTimes(Integer loginTimes) {
		this.loginTimes = loginTimes;
	}

	public String getIpAddress() {
		return ipAddress;
	}

	public void setIpAddress(String ipAddress) {
		this.ipAddress = ipAddress;
	}

	public String getSourceChannelCode() {
		return sourceChannelCode;
	}

	public void setSourceChannelCode(String sourceChannelCode) {
		this.sourceChannelCode = sourceChannelCode;
	}

	public String getMessageCode() {
		return messageCode;
	}

	public void setMessageCode(String messageCode) {
		this.messageCode = messageCode;
	}

	public Date getLastCodeTime() {
		return lastCodeTime;
	}

	public void setLastCodeTime(Date lastCodeTime) {
		this.lastCodeTime = lastCodeTime;
	}

	@Override
	public String toString() {
		return "SourceUserLoginInfo{" +
				"phoneNumber='" + phoneNumber + '\'' +
				", sourceH5Code='" + sourceH5Code + '\'' +
				", loginTimes=" + loginTimes +
				", ipAddress='" + ipAddress + '\'' +
				", sourceChannelCode='" + sourceChannelCode + '\'' +
				", messageCode='" + messageCode + '\'' +
				", lastCodeTime=" + lastCodeTime +
				'}';
	}
}
